﻿using Qianke.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Unity;

namespace MainFrame.Common
{
    public class ServiceContainer : IServiceContainer, IScopedDependency
    {
        public IUnityContainer UnityContainer { get; set; }

        public TService GetService<TService>()
        {
            return UnityContainer.Resolve<TService>();
        }

        public void SetContainer(object container)
        {
            UnityContainer = container as IUnityContainer;
        }
    }
}
